#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableUnionSceneTypeDao:DaoBase<TableUnionSceneType>
    {
        public override string GetFileName()
        {
            return "TableUnionSceneType.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableUnionSceneType>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableUnionSceneType model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.id)) UnityEngine.Debug.LogError("数据表id重复:TableUnionSceneType->id: " + model.id);
            #endif
            cachePrimaryInt[model.id] = model;
        }
        protected override TableUnionSceneType ParseRowData(string[] rowData)
        {
            TableUnionSceneType data = new TableUnionSceneType();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.id = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.sceneMapId = int.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.type = int.Parse(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.createCost = string.Intern(rowData[3]);
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.modifyUnionNameCost = string.Intern(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.resource = rowData[5];
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.initResource = string.Intern(rowData[6]);
            }
            return data;
        }
    }
}
